package com.typhoon.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import com.typhoon.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author shuya | dongfeng.zdf@alibaba-inc.com
 * @description
 * @date 2018/10/18 下午1:53
 * @description
 * @modified by
 * @since V2.0.0
 */
@Controller
@Slf4j
public class IndexController {
    @RequestMapping("/user/{id}")
    public String queryUser(@PathVariable("id") Long id, Model model) {
        User user = new User();
        user.setId(id);
        user.setName("Typhoon");
        user.setAge(28);
        user.setSex(1);
        model.addAttribute("user",user);
        return "/index";

    }

}
